﻿#include "tfmainwindow.h"
#include <QQuickWidget>
#include <QHBoxLayout>
#include <QQuickItem>
#include <QMetaObject>

TFMainWindow::TFMainWindow(QWidget *parent) : QMainWindow(parent)
{
    setWindowFlags(Qt::Window|Qt::FramelessWindowHint
                   |Qt::WindowSystemMenuHint|Qt::WindowMinimizeButtonHint|Qt::WindowMaximizeButtonHint);
    QQuickWidget *view = new QQuickWidget;
    view->setSource(QUrl::fromLocalFile("ScrollViewPage.qml"));
    view->setResizeMode(QQuickWidget::SizeRootObjectToView);
    setCentralWidget(view);

    QQuickItem *item = view->rootObject();
    if(item){
        QString title = (this->metaObject()->className());
        QMetaObject::invokeMethod(item,"setTitle",Q_ARG(QVariant,title));
    }
}
